package com.meilai.project.mapper.business.media;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.meilai.project.entity.media.MediaPointAB;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface MediaPointABMapper extends BaseMapper<MediaPointAB> {

    @Delete("DELETE FROM media_point_ab where id = (select w.id from (select id from `media_point_ab` where (a_point_id = #{id} or b_point_id = #{id}))w)")
    int deleteBefore(@Param("id") Long id);
}
